package com.atwy.storage.mapper;

import com.atwy.storage.model.StorageDo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface StorageMapper {

    @Select("select id,commodity_code commodityCode,count,freeze_count freezeCount from storage_tbl where commodity_code = #{commodityCode}")
    StorageDo queryStorageByCommodityCode(@Param("commodityCode") String commodityCode);

    @Update("update storage_tbl set count = #{count},freeze_count = #{freezeCount} where commodity_code = #{commodityCode}")
    int updateStorage(StorageDo storageDo);

}
